home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / WINIO / WINIO.H < prev    next >
C/C++ Source or Header  |  1994-12-21  |  2KB  |  84 lines

  1. /*
  2. WINIO.H
  3. Stdio (e.g. printf) functionality for Windows - definition
  4. Dave Maxey - 1991
  5. */
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11. /* ==== STDIO.H for Windows ==== */
  12. #include <stdarg.h>
  13.  
  14. #ifdef __BORLANDC__
  15. /* Borland C++ STDIO.H doesn't do gets, etc. #if defined(_Windows) */
  16. #undef _Windows
  17.  
  18. #include <stdio.h>
  19. #define _Windows
  20. #else
  21. #include <stdio.h>
  22. #endif
  23.  
  24. /* ==== Extensions ==== */
  25.  
  26. extern HINSTANCE _hinst;
  27. extern HINSTANCE _hprevinst;
  28. extern LPCSTR _lpcmdline;
  29. extern int _ncmdshow;
  30.  
  31. char*    winio_gets(char *);
  32. int    winio_puts(const char *);
  33.  
  34. /* winio_init() must be called before any of the above listed
  35. functions to init the i/o window. Similar arguments to WinMain(), but
  36. we drop the cmdline pointer but add a bufsize parameter (unsigned) -
  37. 0 means default (8k). */
  38. int winio_init(HANDLE, HANDLE, int, unsigned);
  39.  
  40. /* Makes the window inactive, and allows the user to view and play with
  41. it until double- clicking on the system menu to close it. NEVER RETURNS. */
  42. void winio_end(void);
  43.  
  44. /* closes the window immediately and frees up buffers */
  45. void winio_close(void);
  46.  
  47. /* to override default title of "Console I/O" */
  48. void winio_settitle(BYTE *);
  49.  
  50. /* May be SYSTEM_FIXED_FONT (default), ANSI_FIXED_FONT, or OEM_FIXED_FONT */
  51. BOOL winio_setfont(WORD);
  52.  
  53. /* To turn automatic updating of window off and on */
  54. BOOL winio_setpaint(BOOL);
  55.  
  56. /* To change the behavior of getchar() */
  57. BOOL winio_setecho(BOOL);
  58.  
  59. /* clear out the contents of the buffer and start over fresh */
  60. void winio_clear(void);
  61.  
  62. /* should be used to release cpu in spells between I/O calls. A
  63. WM_QUIT message received by it will exit the application. If that is
  64. a problem, use the winio_onclose function below */
  65. void winio_yield(void);
  66.  
  67. /* Returns the underlying Windows window handle to WINIO window */
  68. HWND winio_hwnd(void);
  69.  
  70. /* ==== User definable exit routine ==== */
  71.  
  72. typedef void (* DESTROY_FUNC)(void);
  73.  
  74. /* Optional notification function; without it, there is no way for your
  75. application to know if the user has double-clicked the system menu box */
  76. void winio_onclose(DESTROY_FUNC);
  77.  
  78. /* ==== Utility function built on message box ==== */
  79.  
  80. BOOL winio_warn(BOOL, const BYTE *, ...);
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84.